{% trans_default_domain 'templatesTranslations' %}

<form action="{{ path('fos_user_change_password') }}" {{ form_enctype(form) }} method="POST" class="fos_user_change_password form-horizontal" role="form">
	<fieldset>
        {% if not form.vars.valid %}
	        <div class="alert alert-block alert-danger fade in">
	            <button class="close" data-dismiss="alert" href="#" aria-hidden="true">&times;</button>
	            {% if form_errors(form.current_password) is not null %}
					{{ form_errors(form.current_password) }}
	            {% endif %}
	            {% if form_errors(form.plainPassword.first) is not null %}
					{{ form_errors(form.plainPassword.first) }}
	            {% endif %}
	            {% if form_errors(form.plainPassword.second) is not null %}
					{{ form_errors(form.plainPassword.second) }}
	            {% endif %}
	        </div>
        {% endif %}
	    <legend>{{ 'change_password.title'|trans }}</legend>
	    <div class="form-group">
	        <label class="control-label col-xs-4 col-sm-2 col-md-2">{{ form_label(form.current_password) }}</label>
	        <div class="col-xs-8 col-sm-10 col-md-10">
	            {{ form_widget(form.current_password, { 'attr': {'class': 'form-control'} }) }}
	        </div>
	    </div>
	    <div class="form-group">
	        <label class="control-label col-xs-4 col-sm-2 col-md-2">{{ form_label(form.plainPassword.first) }}</label>
	        <div class="col-xs-8 col-sm-10 col-md-10">
	            {{ form_widget(form.plainPassword.first, { 'attr': {'class': 'form-control'} }) }}
	        </div>
	    </div>
	    <div class="form-group">
	        <label class="control-label col-xs-4 col-sm-2 col-md-2">{{ form_label(form.plainPassword.second) }}</label>
	        <div class="col-xs-8 col-sm-10 col-md-10">
	            {{ form_widget(form.plainPassword.second, { 'attr': {'class': 'form-control'} }) }}
	        </div>
	    </div>
	    <input type="submit" value="{{ 'change_password.submit'|trans }}" class="btn btn-primary"/>
	    <a href={{ path('fos_user_profile_show') }} class='btn btn-default'> {{ 'common.go_back'|trans }} </a>
	    {{ form_row(form._token) }}
    </fieldset>
</form>
